package com.test.controller;

import com.test.entity.Book;
import com.test.result.Result;
import com.test.service.BookService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@Slf4j
@RestController
public class LoginController {

    @Resource
    private BookService bookService;

    @GetMapping("/test")
    public Result<Boolean> test() {
        SecurityContext context = SecurityContextHolder.getContext();
        System.out.println("test方法的打印："+context.getAuthentication());
        return Result.success(true);
    }

}
